package com.glsc.ngateway.common.api.platform.dto.other;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author liwei
 * 交易单元租用信息
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TradeSeatSpeedFlowDto {


    @ApiModelProperty(value = "交易单元号")
    @Column(name = "trade_seat_code", columnDefinition = "varchar(10) COMMENT '交易单元号'")
    private String tradeSeatCode;


    @ApiModelProperty(value = "流速权")
    @Column(name = "flow_speed_weight", columnDefinition = "int(11) COMMENT '流速权'")
    private BigDecimal flowSpeedWeight;


    @ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
    @Column(name = "create_time", columnDefinition = "datetime comment '创建时间'", updatable = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime createTime;

}
